﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application With Diphap.JsNetBridge.Mvc</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Styles.Render("~/Content/themes/base/css")
</head>
<body>
    <div id="userSettings">
        @Html.Partial("_UserSettings")
    </div>

    <div id="body">
        @RenderBody()
    </div>

    <footer>
        <nav>
            <ul id="menu">
                <li>@Html.ActionLink("Todo List", "Index", "Home", new { area = "" }, null)</li>
                <li>@Html.ActionLink("API", "Index", "Help", new { area = "HelpPage" }, null)</li>
            </ul>
        </nav>
        <p>Learn more about <a href="http://jsnet.codeplex.com/ " target="_blank">Diphap.JsNetBridge.Mvc</a></p>
        <p>Learn more about <a href="http://go.microsoft.com/fwlink/?LinkId=273732" target="_blank">Single Page Applications</a></p>
        <p>&copy; @DateTime.Now.Year - My ASP.NET MVC Application</p>
    </footer>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/ajaxlogin")

    @* JsNetBridge: it will generate the url. *@
    @Scripts.Render("~/bundles/JsNetBridge")
    <script>

		@* retrieves the route templates (ex: "{controller}/{action}/{id}" or api/{controller}/{id} *@
        $dp.$JsNet.$Helpers.$Api.$Routes.$selectedRoute.$RouteTemplate = '@(System.Web.Routing.RouteTable.Routes["DefaultApi"] == null ? "" : (System.Web.Routing.RouteTable.Routes["DefaultApi"] as System.Web.Routing.Route).Url)';
        $dp.$JsNet.$Helpers.$Mvc.$Routes.$selectedRoute.$RouteTemplate = '@(System.Web.Routing.RouteTable.Routes["Default"] == null ? "" : (System.Web.Routing.RouteTable.Routes["Default"] as System.Web.Routing.Route).Url)';

        @* generates the url of action method. *@
        @(new MvcHtmlString(SingleAppExample.MvcApplication.AspMvcInfo.UrlInfo.ToJS_SetUrl(new Diphap.JsNetBridge.Mvc.Proxy.UrlManager(this.Url.Action, this.Url.RouteUrl),"DefaultApi")))

    </script>
    @* JsNetBridge: example of use. Read the prerequisites in the script 'Diphap.JsNetBridge.Example.js' *@
    <script src="~/Scripts/Diphap.JsNetBridge/Diphap.JsNetBridge.Example.js"></script>

    @RenderSection("scripts", required: false)

</body>
</html>
